<?php
use yii\helpers\Html;
use front\assets\AppAsset;
use yii\helpers\Url;

$this->title = '商品搜索';
?>
<body class="m-sch">
<dl class="fm f-cb">
    <dl class="fm f-cb">
        <dt><a href="javascript:search();">搜索</a></dt>
        <dd><input id="J_search" type="text" value="VR 眼镜" /></dd>
    </dl>
</dl>

<dl class="list">
    <dt>历史搜索</dt>
    <dd>
        <a href="javascript:;">健身仪</a>
        <a href="javascript:;">VR眼镜</a>
        <a href="javascript:;">扫描仪</a>
        <a href="javascript:;">机器人</a>
    </dd>
</dl>

<h4><a href="javascript:;" id="J_clearHis">清除历史记录</a></h4>

<dl class="list">
    <dt>热门搜索</dt>
    <dd>
        <a href="javascript:;">手机壳</a>
        <a href="javascript:;">高能杯</a>
        <a href="javascript:;">充电宝</a>
        <a href="javascript:;">双肩包</a>
        <a href="javascript:;">耳机</a>
        <a href="javascript:;">跑步鞋</a>
        <a href="javascript:;">女装</a>
        <a href="javascript:;">眼镜</a>
    </dd>
</dl>

<script>
    $(function(){

        $('#J_clearHis').tap(function(){

            var _parent = $(this).parent();

            _parent.prev().remove();
            _parent.remove();
        });
    });


    //把搜索的内容传递到搜索结果，跳转到搜索结果商品页面显示
    function search()
    {
        window.location.href = 'list?keyWords='+ $.trim($("#J_search").val());
    }
</script>
</body>